﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Common.Infrastructure
{
    public class ApiPagedResult<T>
    {
        /// <summary>
        /// 统一格式的分页结果集
        /// </summary>
        public ApiPagedResult()
        {
        }

        /// <summary>
        /// 统一格式的分页结果集
        /// </summary>
        /// <param name="totalCount">总数</param>
        /// <param name="items">结果集</param>
        public ApiPagedResult(int totalCount, List<T> items)
        {
            this.TotalCount = totalCount;
            this.Data = items;
        }

        /// <summary>
        /// 总数
        /// </summary>
        public int TotalCount { get; set; } = 0;

        /// <summary>
        /// 数据集合
        /// </summary>
        public List<T> Data { get; set; } = null;
    }
}
